import os
import os.path as p
import time
import shutil

print(os.getcwd())
# os.mkdir('os_test')
# os.mkdir('os_test')   # 当文件已存在时，无法创建该文件。
# os.mkdir('D:\\24_computer_z3\\file_demo\\mk_test')
# os.chdir('D:\\24_computer_z3\\file_demo\\os_test')
# file = open('1.txt','w')
# file.write("1112222")
# os.rename('1.txt','2.txt')
# os.chdir('D:\\24_computer_z3\\file_demo')
# os.remove('1.txt')

# os.chdir('D:\\24_computer_z3\\file_demo\\mk_test')
# for i in range(0,10):
#     path = 'test_0{}'.format(i)
#     # os.mkdir(path)
#     os.chdir('D:\\24_computer_z3\\file_demo\\mk_test\\{}'.format(path))
#     for j in range(10,20):
#         path_01 = 'test_0{}'.format(j)
#         os.mkdir(path_01)
#         path_02 = 'test_{}.txt'.format(j)
#         file_01 = open(path_02,'w')
#         file_01.write('111222{}'.format(j))

# os.chdir('D:\\24_computer_z3\\file_demo\\mk_test')
# for i in range(0,10):
#     path = 'test_0{}'.format(i)
#     # os.mkdir(path)
#     os.chdir('D:\\24_computer_z3\\file_demo\\mk_test\\{}'.format(path))
#     for j in range(10,20):
#         path_02 = 'test_{}.txt'.format(j)
#         os.remove(path_02)
#         path_01 = 'test_0{}'.format(j)
#         os.rmdir(path_01)

# os.chdir('D:\\24_computer_z3\\file_demo\\os_test')
# os.remove('2.txt')
# os.mkdir('test_01')
# os.chdir('D:\\24_computer_z3\\file_demo')
# os.mkdir('test_001')
# os.removedirs('D:\\24_computer_z3\\file_demo\\os_test\\test_01\\test_001')
# print(os.listdir('D:\\24_computer_z3\\file_demo'))
# print(os.listdir('D:\\24_computer_z3\\file_demo\\mk_test'))


a_time = p.getatime('D:\\24_computer_z3\\file_demo\\__init__.py')
print(a_time)
print(time.strftime('%Y-%m-%d %H:%M:%S'))

